package com.wodsy.phoenix.dataobject.orderc.model;

import com.wodsy.phoenix.dataobject.base.PhoenixObject;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import java.util.Date;

/**
 * Payment entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "tb_payment", catalog = "orderc")
public class Payment extends PhoenixObject {

	// Fields

	private Integer id;
	private Long orderId;
	private PaymentType paymentType;
	private Integer paymentSubtype;
	private Double paymentAmount;
	private PaymentStatus paymentStatus;
	private Date createTime;
	private Date updateTime;

	// Constructors

	/** default constructor */
	public Payment() {
	}

	/** minimal constructor */
	public Payment(Integer id, Long orderId, Date createTime,
			Date updateTime) {
		this.id = id;
		this.orderId = orderId;
		this.createTime = createTime;
		this.updateTime = updateTime;
	}

	/** full constructor */
	public Payment(Integer id, Long orderId, PaymentType paymentType,
			Integer paymentSubtype, Double paymentAmount,
			PaymentStatus paymentStatus, Date createTime, Date updateTime) {
		this.id = id;
		this.orderId = orderId;
		this.paymentType = paymentType;
		this.paymentSubtype = paymentSubtype;
		this.paymentAmount = paymentAmount;
		this.paymentStatus = paymentStatus;
		this.createTime = createTime;
		this.updateTime = updateTime;
	}

	// Property accessors
	@Id
	@Column(name = "id", unique = true, nullable = false)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@Column(name = "order_id", nullable = false)
	public Long getOrderId() {
		return this.orderId;
	}

	public void setOrderId(Long orderId) {
		this.orderId = orderId;
	}

	@Column(name = "payment_type")
	public PaymentType getPaymentType() {
		return this.paymentType;
	}

	public void setPaymentType(PaymentType paymentType) {
		this.paymentType = paymentType;
	}

	@Column(name = "payment_subtype")
	public Integer getPaymentSubtype() {
		return this.paymentSubtype;
	}

	public void setPaymentSubtype(Integer paymentSubtype) {
		this.paymentSubtype = paymentSubtype;
	}

	@Column(name = "payment_amount", precision = 22, scale = 0)
	public Double getPaymentAmount() {
		return this.paymentAmount;
	}

	public void setPaymentAmount(Double paymentAmount) {
		this.paymentAmount = paymentAmount;
	}

	@Column(name = "payment_status")
	public PaymentStatus getPaymentStatus() {
		return this.paymentStatus;
	}

	public void setPaymentStatus(PaymentStatus paymentStatus) {
		this.paymentStatus = paymentStatus;
	}

	@Column(name = "create_time", nullable = false, length = 19)
	public Date getCreateTime() {
		return this.createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	@Column(name = "update_time", nullable = false, length = 19)
	public Date getUpdateTime() {
		return this.updateTime;
	}

	public void setUpdateTime(Date updateTime) {
		this.updateTime = updateTime;
	}

	/* -支付宝 1-网银 2-银联 3-礼品卡 4-优惠券 */
	public static enum PaymentType{
		ZHIFUBAO,
		WANGYIN,
		YINLIAN,
		LIPINKA,
		YOUHUIQUAN
	}
	/*支付状态 0-未支付 1-已支付 2-支付异常*/
	public static enum PaymentStatus{
		UNPAY,PAYSUCCESS,PAYEXCEPTION
	}
}